Skip to content

use namedtuple for measurement_value #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 28, 2020
Merged

Conversation

dhalbert
Copy link
Contributor

@dhalbert dhalbert commented Jan 28, 2020

Printing HeartRateService.measurement_valuse now looks like:

HeartRateMeasurementValues(heart_rate=60, contact=None, energy_expended=None, rr_intervals=[1024])
HeartRateMeasurementValues(heart_rate=58, contact=None, energy_expended=None, rr_intervals=[1059])

and you can now do things like:

print(svc.measurement_values.heart_rate)  # print heart rate

instead of

print(svc.measurement_values[0])  # print heart rate

Also I fixed some sphinx documentation bugs.

(EDIT: Fixed measurement values names to be plural)

@dhalbert dhalbert requested a review from jedgarpark January 28, 2020 17:48
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. You or @jedgarpark can merge whenever. Not sure if @jedgarpark wants to look at it.

Note your example in your PR description needs the property to be plural measurement_values to match the implementation.

@dhalbert
Copy link
Contributor Author

Looks good to me. You or @jedgarpark can merge whenever. Not sure if @jedgarpark wants to look at it.

Note your example in your PR description needs the property to be plural measurement_values to match the implementation.

Whoops! Fixed. I missed that .measurement_values was originally plural -- I was spending a lot more time fighting with sphinx than anything else. Now all the names match in pluralness.

@dhalbert dhalbert merged commit b3624de into adafruit:master Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants